# -*- coding: utf-8 -*-
# @Time        :2024/9/26 下午4:27
# @Author      :文刀水寿
# @File        : file_util.py.py
"""
 @Description :
"""


def print_file_info(file_name):
    f = open("file_name", 'w', encoding='UTF-8')
    try:
        f.read()
    except Exception as e:
        print("文件不存在")
    finally:
        if f:
            f.close()


def append_to_file(file_name, data):
    f = open("file_name", 'a', encoding='UTF-8')
    f.write(data)
    f.close()


if __name__ == '__main__':
    print_file_info("C:\新建文件夹\测试.txt")
    append_to_file("C:\新建文件夹\测试.txt", "1234")
